/**
 * Created by Administrator on 2017/3/2 0002.
 */
var Game={
    create:function () {
        var game={};
        var con=new PIXI.DisplayObjectContainer();
        var sc;
        game.ui=con;



        var page0=Page0.create();
        game.ui.addChild(page0.ui);
        page0.In();




        document.addEventListener('Game_ScrollIn',scrollInHandler);
        document.addEventListener('AA_ScrollStart',startHandler);
        document.addEventListener('AA_ScrollComplete',completeHandler);

        // document.dispatchEvent(new CustomEvent('Game_ScrollIn'));
        
        function scrollInHandler() {
            page0.Out();
            threeOut();

            var scCon=new PIXI.DisplayObjectContainer();
            game.ui.addChild(scCon);
            var arr_page=[];

            var page1=Page1.create();
            var page2=Page2.create();
            var page3=Page3.create();
            var page4=Page4.create();
            var page5=Page5.create();
            arr_page.push(page1,page2,page3,page4,page5);
            for(var i=0;i<arr_page.length;i++)
            {
                scCon.addChildAt(arr_page[i].ui,0);
                arr_page[i].ui.y=1136*i;
            }
            sc=Scroller.create(scCon,pixiStageW,pixiStageH,'ver','AA',arr_page);
            arr_page[0].In();
        }
        
        function startHandler(e) {
            sc.arrPage[e.detail].Out()
        }

        function completeHandler(e) {
            sc.arrPage[e.detail].In()
        }
        return game;
    }

}